#include "ItemView.h"
#include "src/ListWidgetDemo.h"
#include "src/StringListDemo.h"

#include <QMessageBox>
#include <QStringList>
#include <QtGui/QApplication>

int main(int argc, char *argv[])
{
	QApplication app(argc, argv);

	//QMap<int, QString> symbolMap;
	//symbolMap.insert(1, "data.png");
	//symbolMap.insert(2, "decision.png");
	//symbolMap.insert(3, "document.png");
	//symbolMap.insert(4, "manual-input.png");

	//ListWidgetDemo listWidgetDemo(symbolMap);
	//listWidgetDemo.setWindowModality(Qt::ApplicationModal);
	//listWidgetDemo.exec();
	//int i = listWidgetDemo.selectedId();
	//QString prompt;
	//if (i >= 0) {
	//	prompt = QObject::tr("You select no %1: %2.")
	//		.arg(i).arg(symbolMap.value(i, ""));
	//} else {
	//	prompt = QObject::tr("You haven't select any one.");
	//}
	//QMessageBox::information(0, QObject::tr("Select result"), prompt);

	QStringList stringList;
	stringList.append("Apple");
	stringList.append("Banana");
	stringList.append("Grape");

	StringListDemo stringListDemo(stringList);
	stringListDemo.setWindowModality(Qt::ApplicationModal);
	stringListDemo.exec();
	int i = stringListDemo.selectedId();
	QString prompt;
	if (i >= 0) {
		prompt = QObject::tr("You select no %1: %2.")
			.arg(i).arg(stringList.at(i));
	} else {
		prompt = QObject::tr("You haven't select any one.");
	}
	QMessageBox::information(0, QObject::tr("Select result"), prompt);

	//app.exec();
	//return app.exec();
	return 0;
}
